package com.thevenin.launcher;

import com.thevenin.utils.BitRateCalculatorFonc;

public class BitRateCalculatorMain {

	public static void usage() {
		System.out.println("Calcule le video bitrate (Kbps) à utiliser lors de l'encodage d'une vidéo.");
		System.out.println("Utilisation :");
		System.out.println("  BitRateCalculator desiredMoSize durationHours durationMinutes durationSeconds audioBitRateInKbps");
		System.out.println("");
		System.out.println("ex:  BitRateCalculator 700 1 36 5 128");
	}
	
	public static void main(String[] args) {
		if (args.length != 5) {
			usage();
			return;
		}
		Integer desiredMoSize = Integer.valueOf(args[0]);
		Integer durationHours = Integer.valueOf(args[1]);
		Integer durationMinutes = Integer.valueOf(args[2]);
		Integer durationSeconds = Integer.valueOf(args[3]);
		Integer audioBitRateInKbps = Integer.valueOf(args[4]);
		
		System.out.println("Video kbps : " + BitRateCalculatorFonc.calculBitrate(desiredMoSize, durationHours, durationMinutes, durationSeconds, audioBitRateInKbps));

	}

}
